<?php
$crumbParents=array(
	'servers'=>'main',
	'search'=>'main',
	'searchresults'=>'search',
	'browse'=>'main'
	);
$crumbNames=array(
	'main'=>'Main',
	'servers'=>'Server Statistics',
	'search'=>'Search',
	'searchresults'=>'Search Results',
	'browse'=>'Server Browser'
	);
$crumbPages=array(
	'main'=>'index.php',
	'search'=>'search.php',
	);
	
function showCrumbs($level)
{
	global $crumbParents;
	global $crumbNames;
	global $crumbPages;
	
	$stack=array($level);
	$curlevel=$level;
	
	while (isset($crumbParents[$curlevel]))
	{
		$curlevel=$crumbParents[$curlevel];
		array_push($stack,$curlevel);
	}
	
	echo '<div id="crumbs">You are here: ';
	for ($i=count($stack)-1;$i>=0;$i--)
	{
		$curcrumb=$stack[$i];
		
		if ($i>0 && isset($crumbPages[$curcrumb]))
			echo '<a href="'.$crumbPages[$curcrumb].'">'.$crumbNames[$curcrumb].'</a>';
		else
			echo $crumbNames[$curcrumb];
		
		if ($i>0)
			echo '&raquo;';
	}
	echo "</div>\n";
}